package com.googlecode.synccontacts.listeners;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import com.googlecode.synccontacts.activity.SettingActivity;
import com.googlecode.synccontacts.interfaces.SocialNetwork;

/**
 * User: volkovma@inbox.ru
 * Date: 11.02.11
 * Setting button listener
 */
public class OpenSettingListener implements View.OnClickListener {
    private int netType;
    private Activity parentActivity;

    /**
     * Конструктор
     *
     * @param SocNetType для какой сети открыть форму
     */
    public OpenSettingListener(int SocNetType, Activity parentActivity) {
        this.netType = SocNetType;
        this.parentActivity = parentActivity;
    }

    public void onClick(View view) {
        Intent intent = new Intent();
        intent.setClass(parentActivity, SettingActivity.class);
        intent.putExtra(SocialNetwork.SOCIAL_NETWORK,netType);
        parentActivity.startActivity(intent);
        parentActivity.finish();
    }
}
